Skip to content

extend annotation options#270

Merged
mcncl merged 5 commits into
mainfrom
feat/extend_annotations
May 19, 2026
Merged

extend annotation options#270
mcncl merged 5 commits into
mainfrom
feat/extend_annotations

Conversation

@mcncl
Copy link
Copy Markdown
Contributor

@mcncl mcncl commented May 19, 2026

Description

This PR extends the annotations package in the MCP to support job-level annotations. It also allows for other function like creating and deleting.

Changes

  • adds support for job-level annotations (with tests)
  • adds create and list function (job) to annotations for more options via the MCP
  • updates the toolset

Testing

Can be pulled down and tested locally with a annotation-scoped API token (as well as build and pipeline scope for annotation discovery)

go test ./... -v

Copilot AI review requested due to automatic review settings May 19, 2026 00:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR expands the existing Buildkite annotations support in the MCP server to cover job-level annotations in addition to build-level annotations, and adds write capabilities (create/delete) for both scopes so callers can manage annotations via MCP tools.

Changes:

  • Added MCP tools to create and delete build-level annotations.
  • Added MCP tools to list, create, and delete job-level annotations.
  • Updated the built-in “Annotation Management” toolset to include the new tools and updated descriptions.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
pkg/toolsets/toolsets.go Expands the Annotation Management toolset to include build/job create/delete/list tools and updates the toolset description.
pkg/buildkite/annotations.go Extends the annotations tool surface area (new args + handlers) for build/job create/delete/list operations.
pkg/buildkite/annotations_test.go Adds unit tests and mock client support for the new annotation operations (build + job).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wolfeidau
Copy link
Copy Markdown
Member

wolfeidau commented May 19, 2026

@mcncl here is my feedback.

  1. Lets not add delete operations, I have so far avoided this because I think you talked me out of it.
  2. Could we just have one set of list/create and use scope like the buildkite-agent annotate?
--scope value               The scope of the annotation, which will control where the annotation is displayed in the Buildkite UI. One of 'build', 'job' (default: "build") [$BUILDKITE_ANNOTATION_SCOPE]

With the default being build.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Comment thread pkg/toolsets/toolsets.go
Comment on lines 364 to 370
ToolsetAnnotations: {
Name: "Annotation Management",
Description: "Tools for managing build annotations",
Description: "Tools for managing build and job annotations",
Tools: []ToolDefinition{
newToolDef(buildkite.ListAnnotations),
newToolDef(buildkite.CreateAnnotation),
},
Copy link
Copy Markdown
Member

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, keen to try it out!

@mcncl mcncl merged commit b113bc6 into main May 19, 2026
4 checks passed
@mcncl mcncl deleted the feat/extend_annotations branch May 19, 2026 04:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants